
<!--  header -->
<%@ include file="../layouts/header.jsp" %>

<!--  body -->
<div class="Main">
  <div class="Main_fix">


   <%@ include file="../layouts/left.jsp" %>

	<script type="text/javascript">
			function remove(href,message){
				if(confirm(message)){
					window.location.href=href;
				}
			}
	</script>
	<!-- main body --> 	
  	<div class="Main_body" id="Main_body">
      <div class="Main_locationBar">
        <div class="Main_locationBar_head"></div>
        <div class="Main_locationBar_body">
        	<span id="CurrentPosition"><fmt:message key="project.name"/> > Book</span>
        </div>
        <div class="Main_locationBar_foot"></div>
      </div>
      
	  <div class="Main_bodyListBar">
        <div class="Main_bodyListBar_head">
        	<span>Book</span>
        </div>
        <div class="Main_bodyListBar_body">
            
            <c:if test="${flash['message']!=null}">
					<li>
						${flash['message']}
					</li>
					</c:if>
            
          <table border="0" cellspacing="0" cellpadding="0" class="listTable">
             <tr>
                 
                <th>ID</th>
                <th>Name</th>
                <th>Created At</th>
                <th>Updated At</th> 
                <th colspan="3">Operation</th>
             </tr>
            <c:forEach var="book" items="${bookList}">
  			 <tr>
  			  	<td>${book.id}</td>
  			  	<td>${book.name}</td>
  			  	<td>${book.createdAt}</td>
  			  	<td>${book.updatedAt}</td>
  			  	<td>
  			  		<j:link controller="book" action="show" oid="${book.id}"><fmt:message key="form.button.show"/></j:link>
  			  		<j:link controller="book" action="edit" oid="${book.id}"><fmt:message key="form.button.edit"/></j:link>
  			  		<a href="#" onclick="remove('<j:href controller="book" action="delete" oid="${book.id}"/>','Delete this book?')"><fmt:message key="form.button.delete"/></a>
  			  	</td>
  			</tr>		   
    		</c:forEach>
            </table> 
        </div>
        <div class="Main_bodyListBar_foot"></div>       
      </div> 

		<div class="Main_buttonGroupBar_body">
          			<input type="button" class="button" value="<fmt:message key="form.button.new"/>" onclick="window.location = '<j:href controller="book" action="create"/>'"/>
       </div>
  </div>
 </div>
<!--  footer -->
<%@ include file="../layouts/footer.jsp" %>